package com.xx566.blog.interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.core.ActionInvocation;

/**
 * LoginInterceptor.
 */
public class LoginInterceptor implements Interceptor {

	@Override
	public void intercept(ActionInvocation ai) {
		Integer userid = ai.getController().getSessionAttr("xx566_userid");
		if(userid==null){
			ai.getController().redirect("/admin/login");
		}else{
			ai.invoke();
		}
		
	}


}
